#pragma once
#include <string>

class GpioControl {
public:
    GpioControl(int gpioNum);
    ~GpioControl();

    bool exportGpio();
    bool unexportGpio();
    bool setDirection(const std::string& direction); // "in" or "out"
    bool setValue(int value);                        // 0 or 1
    int  getValue();

private:
    int gpioNum_;
    std::string gpioPath_;

    bool writeToFile(const std::string& path, const std::string& value);
    bool readFromFile(const std::string& path, std::string& value);
};
